// https://leetcode.cn/problems/design-circular-queue/
// Created by ade on 2022/8/2.
//
#include <iostream>
#include <vector>

using namespace std;


class MyCircularQueue {
public:
    int total, count;
    vector<int> queue;

    MyCircularQueue(int k) {
        total = k;
    }

    bool enQueue(int value) {
        if (count + 1 > total)
            return false;
        queue.push_back(value);
        count++;
        return true;
    }

    bool deQueue() {
        if (count > 0) {
            vector<int> tmp{queue.begin() + 1, queue.end()};
            queue = tmp;
            count--;
            return true;
        }
        return false;
    }

    int Front() {
        if(count == 0) return -1;
        return queue[0];
    }

    int Rear() {
        if(count == 0) return -1;
        return queue.back();
    }

    bool isEmpty() {
        return count == 0;
    }

    bool isFull() {
        return count == total;
    }
};

// ["MyCircularQueue","enQueue","Rear","Rear","deQueue","enQueue","Rear","deQueue","Front","deQueue","deQueue","deQueue"]
//[[6],[6],[],[],[],[5],[],[],[],[],[],[]]

int main() {
    MyCircularQueue so(6);
    so.enQueue(1);
    so.deQueue();
    so.enQueue(3);
    so.deQueue();
    if(so.enQueue(4)){
        cout << "yes" <<endl;
    }else{
        cout << "no" << endl;
    }
    cout << so.count << endl;
    cout << so.total << endl;
    return 0;
}